<div class="fixed-bar">
    <form class="layui-form layui-form-pane fixed-bar-form" action="{:url('', ['id' => $materialId])}" method="get" id="hisi-table-search">
    <div class="layui-form-item">
     <div class="layui-inline">
     	<label class="layui-form-label">订单号</label>
         <div class="layui-input-inline">
             <input type="text" name="client_ordernum" lay-verify="" placeholder="输入订单号" class="layui-input">
         </div>
     </div>
     
     <div class="layui-inline">
     	<label class="layui-form-label">产品SKU</label>
         <div class="layui-input-inline">
             <input type="text" name="sku" lay-verify="" placeholder="输入产品SKU" class="layui-input">
         </div>
     </div>
     
     <div class="layui-inline">
     	<button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">搜索</button>
     </div>
    </div>
    </form>
</div>

<table id="dataTable"></table>

{include file="system@block/layui" /}


<script type="text/html" id="createTimeTpl">
    <div>{{layui.util.toDateString(d.create_time * 1000) }}</div>
</script>

<script type="text/javascript">
    layui.use(['table', 'tool'], function() {
        var table = layui.table;
        table.render({
            elem: '#dataTable'
            ,url: '{:url("", ["id" => $materialId])}' //数据接口
            ,page: true //开启分页
            ,skin: 'row'
            ,even: true
            ,limit: 20
            ,limits: [20,50,100,150,200]
            ,text: {
                none : '暂无相关数据'
            }
            ,toolbar: true
            ,defaultToolbar: ['filter', 'exports', 'print']
            ,cols: [[ //表头
                {field: 'id', title: '编号',width: 80}
                ,{field: 'client_ordernum', title: '订单号',width: 100,templet:function(d){return '<span class="copy-item">'+d.client_ordernum+'</span>'}}
                ,{field: 'sku', title: '产品SKU',width: 190,templet:function(d){return '<span class="copy-item">'+d.sku+'</span>'}}
				,{field: 'material_dosage', title: '{:config("base.company_short_name")}用量',width: 90}
                ,{field: 'use_num', title: '使用量',width: 80}
                ,{field: '', title: '使用时间', templet: '#createTimeTpl',width: 150}
            ]]
        });
    });
</script>